<div class="page-header">
  <h1>Widgets</h1>
</div>
<ul class="list-unstyled list-inline">
  <li>
    <%= linkTo(newAdminWidgetsPath(), {class: "btn btn-primary"}) { %>
      Create New Widget
    <% } %>
  </li>
</ul>

<table class="table table-striped">
  <thead>
  <th>Name</th>
    <th>&nbsp;</th>
  </thead>
  <tbody>
    <%= for (widget) in widgets { %>
      <tr>
      <td><%= widget.Name %></td>
        <td>
          <div class="pull-right">
            <%= linkTo(adminWidgetPath({ admin_widget_id: widget.ID }), {class: "btn btn-info", body: "View"}) %>
            <%= linkTo(editAdminWidgetPath({ admin_widget_id: widget.ID }), {class: "btn btn-warning", body: "Edit"}) %>
            <%= linkTo(adminWidgetPath({ admin_widget_id: widget.ID }), {class: "btn btn-danger", "data-method": "DELETE", "data-confirm": "Are you sure?", body: "Destroy"}) %>
          </div>
        </td>
      </tr>
    <% } %>
  </tbody>
</table>

<div class="text-center">
  <%= paginator(pagination) %>
</div>
